package com.yjd.comm.enums;

/**
 * 关联类型定义
 * Created by yangchangyan on 2017/6/29.
 */
public enum ReferenceTypeEnum {
    ORGANIZATION(1, "org/", "机构"),
    PROJECT(2, "project/", "项目"),
    DOCTOR(3, "doctor/", "医生"),
    PROJECTCASE(4, "case/", "案例"),
    PORTRAIT(5, "portrait/", "用户头像"),
    APP(6, "app/", "用户android app更新文件"),
    BANK_PICTURE(7, "banklogo/", "银行LOGO"),
    BANNER(8, "banner/", "首页banner"),
    ANOTHER(66, "another/", "其他"),
    MERCHANT_APP(6, "merchant/", "商户android app更新文件")
    ;

    private int code; // 对应的code
    private String path; // 对应label的资源上传路径
    private String label;

    public static ReferenceTypeEnum parse(int code) {
        for (ReferenceTypeEnum v : ReferenceTypeEnum.values()) {
            if (v.getCode() == code) {
                return v;
            }
        }
        return ANOTHER;
    }

    private ReferenceTypeEnum(int code, String path, String label) {
        this.code = code;
        this.path = path;
        this.label = label;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }
}
